﻿<%@ Control Language="C#" AutoEventWireup="true" Inherits="HL.Lib.MVC.ViewControl" %>
<%var model = ViewPage.ViewBag.M as MSearchModel;
     %>
<div class="colum03 fl">
    <p class="searchtt conner4">
        Tìm kiếm nâng cao</p>
    <div class="search">
        <p>
            <label>
                Dịch vụ</label>
            <select id="Services">
                <option>Tất cả</option>
                <%=Utils.ShowDDLMenuByType2("News",1,model!=null?model.Services:0) %>
            </select></p>
        <p>
            <label>
                Khu vực</label><select id="Area">
                    <option>Tất cả</option>
                    <%=Utils.ShowDDLMenuByType2("Area", 1, model != null ? model.Area : 0)%>
                </select></p>
        <p>
            <label>
                Sức chứa của phòng</label><select id="Capacity">
                    <option>Tất cả</option>
                    <%=Utils.ShowDDLMenuByType2("Capacity", 1, model != null ? model.Capacity : 0)%>
                </select></p>
        <p>
            <label>
                Khuyến mãi</label>
                <input type="checkbox" id="Promotion" <%if(model!=null&&model.Promotion==1){%>checked<%} %> />
<%--            <select>
                <option>Tất cả</option>
            </select>--%>
        </p>
        <p>
            <a class="search_bt conner4" href="javascript:;" onclick="doSearch();">Tìm</a></p>
    </div>
</div>
<script type="text/javascript">
    function doSearch() {
        var s = document.getElementById("Services");
        var a = document.getElementById("Area");
        var c = document.getElementById("Capacity");
        var p = document.getElementById("Promotion");
        var sUrl = '';
        if (s.value > 0) sUrl += "Services=" + s.value;
        if (a.value > 0) sUrl += (sUrl == '' ? '' : '&') + "Area=" + a.value;
        if (c.value > 0) sUrl += (sUrl == '' ? '' : '&') + "Capacity=" + c.value;
        if (p.checked) sUrl += (sUrl == '' ? '' : '&') + "Promotion=1";
        if (sUrl == '') alert('Chọn các tiêu chí tìm kiếm.');
        else location.href = '/Search.aspx?' + sUrl;
    }
</script>
